<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../../../resources/common/page/sessionovertime.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<c:set var="path" value="<%=path%>" />
<html>
	<head>
		<title>用户管理</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<style type="text/css">
			.loginlogTd2{border: 1px dotted #CCCCCC;}
			.loginlogTd2 td{border: 1px dotted #CCCCCC;}
			.action-btn {
				height: 25px;
				min-width: 70px;
				color: #000;
				line-height: 25px;
				padding: 0 5px;
				margin-top: 6px;
			}
			.box-author .head {
				display: flex;
				flex-direction: row;
			}
			.box-author .head-r {
			   display: inline-block;
			   line-height: 100px;
			   margin-right: 10px;
			}
			.box-author .head-l {
				display: inline-block;
				flex: 1;
				line-height: 50px;
			}
			.box-author .head-l label {
				margin-left: 10px;
			}
			.box-author .head-l span.textbox,
			.box-author .head-l input.textbox-text {
				width: 120px !important;
			}
			.box-author.operate {
				height: 60px;
				text-align: center;
			}
			.box-author.operate > a.action-btn {
				margin-top: 15px;
			} 
		</style>
		<script type="text/javascript" src="${path}/resources/uams/user.js"></script>
		<script type="text/javascript" src="${path}/resources/uams/authorizationData.js"></script>
		<script type="text/javascript" src="${path}/resources/easyui/datagrid-cellediting.js"></script>
	</head>
	<body style="width: 100%; height: 100%;">
		<div id="toolbar">
			<table style="line-height: 50px;">
				<tr align="left">
				<td  align="right" width="80" >用户名：</td>
				<td >
					<input name="userName" class="easyui-textbox" id="search_userName" data-options="prompt:'模糊查询'" style="width: 150px" />
				</td>
				<td  align="right" width="80" >真实姓名：</td>
				<td >
					<input name="realName" class="easyui-textbox" id="search_realName" data-options="prompt:'模糊查询'" style="width: 150px" />
				</td>
		       
 		        <td width="100" align="right">用户类型：</td>
          		<td width="100" align="left" colspan="3">
          			<select class="easyui-combobox" style="width:135px;" editable="false" id="search_userType" data-options="panelHeight:'auto'">
          				<option value="" selected ="selected" >------</option>
          				<option value="0">UAMS管理员</option>
	        			<option value="1">华大员工</option>
	        			<option value="2">外包同事</option>
	        			<option value="3">外部用户</option>
	        		</select>
          		</td>
          		<!-- <td  align="right" width="80">系统名称：</td>
				<td width="100" align="left">		          		
			  		<input class="easyui-combobox" id="search_systemCode2" size="20" editable="false" data-options="
			          			panelHeight:'250',
			          			valueField:'systemCode',
			          			textField:'systemName',
			          			url:'./resources/findUamsResources.do',
			          			loadFilter:function(data){
			          				return data.rows;
			          			},
			          			prompt:'精确查询'"
			          		/>
		        </td> -->
		         <!-- <td width="100" align="right">角色：</td>
          		<td>
		  			<input class="easyui-textbox" value="" id="roleName" data-options="prompt:'模糊查询'" style="width: 150px"/>
		  		</td> -->
		        <td width="100" align="right">角色：</td>
          		<td width="100" align="left">
	          		<div class="datagrid-toolbar" id="role_search_comboGrid_tools" style="width:100%;height:45px;">
	         				<table>
	          				<tr>
		          				<td align="right" width="65" height="5">系统名称：</td>
		          				<td>
			          				<input class="easyui-combobox" id="role_search_systemCode" size="15" editable="false" data-options="
					          			panelHeight:'250',
					          			valueField:'systemCode',
					          			textField:'systemName',
					          			url:'',
					          			loadFilter:function(data){
					          				return data.rows;
					          			},
					          			prompt:'精确查询'"
					          		/>
		          				</td>
		          				<td align="right" width="65" height="5">角色名称：</td>
		          				<td>
		          					<input class="easyui-textbox" value="" id="search_roleName" size="15" name="search_roleName" data-options="prompt:'模糊查询'"/>
		          				</td>
		          				<td>
			          				<a href="javaScript:refleshSearchSysRole();"style="float:left" name="sysRole_reflesh" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a>
			          				<div class="datagrid-btn-separator" style="float:left"></div>
				       				<a href="javaScript:querySearchSysRole();" style="float:left" name="sysRole_query" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
				          			<div class="datagrid-btn-separator" style="float:left"></div>
		          				</td>
	          				</tr>
	         			</table>
	          		</div>
	          		
          			<input id="searchRoleIds" class="easyui-combogrid" size="20" />
          		</td>
          	</tr>	
          	</table>
			<div style="margin-left: -2px; margin-right: -2px;" class="toolbuttonbg">
				<div class="datagrid-btn-separator"></div>
				<a href="javascript:query()" name="user_query" class="easyui-linkbutton" iconCls="icon-search">查询</a>
				<div class="datagrid-btn-separator"></div>
				<a href="javaScript:openDialog_add();" name="user_add" style="float:left;" class="easyui-linkbutton" iconCls="icon-add">添加</a>
		        <div class="datagrid-btn-separator"></div>
		        <a href="javaScript:openDialog_edit();" name="user_editor" style="float:left;" class="easyui-linkbutton" iconCls="icon-edit">编辑</a>
		        <div class="datagrid-btn-separator"></div>
	       	    <a href="javaScript:;" name="user_updatepaw" style="float:left;" class="easyui-linkbutton" id="updatePasswordBtn" iconCls="icon-lock" onclick="openUpdatePawDiglog()">密码重置</a>
		        <div class="datagrid-btn-separator"></div>
		        <a href="javaScript:delUser();" name="user_delete" style="float:left;" class="easyui-linkbutton" iconCls="icon-cancel">删除</a>
		        <div class="datagrid-btn-separator"></div>
		        <a href="javaScript:;" class="easyui-linkbutton" style="float:left;" id="openDataAuthorization" iconCls="icon-add" onclick="openDataAuthorization();">数据授权</a>
		        <div class="datagrid-btn-separator"></div>
		        <a href="javaScript:refresh();" name="user_refresh" style="float:left;" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
			</div>
		</div>
		
		<!-- 表格 -->
		<table id="dataGridTable" toolbar="#toolbar" fit="true" pagination="true" rownumbers="true" singleSelect="true" fitColumns="false" striped="true" url="<%= basePath%>user/findUamsUsers.do"></table>
	    
	    <!-- 新增/修改表单dialog -->
	    <div id="userInfoDialog" iconCls="icon-save" style="padding: 5px; width: 720px; height: 460px;">
	       <div class="easyui-layout" fit="true">
		       <div region="center" border="false">
		  		<input type="hidden" id="userInfoDialog_userId" value=""/>
		    	<table class="fullTable">
			    	<tr height="30">
		    			<!-- <td width="100" align="right">工号：</td>
		          		<td width="100" align="left"><input type="text" class="easyui-textbox" id="workNumberInfo_out" style="padding: 0px; width: 200px;" disabled="true"></input></td> -->
		          		<td width="87" align="right">用户名：</td>
		          		<td width="100" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_userName" data-options="required:true,missingMessage:'该输入项为必输项'" style="padding: 0px; width: 200px;"></input></td>
		        	
		    			<td width="100" align="right">真实姓名：</td>
		          		<td width="100" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_realName" data-options="required:true,missingMessage:'该输入项为必输项'" style="padding: 0px; width: 200px;"></input></td>
		          	</tr>
		    		<tr height="30">	
		          		<td width="87" align="right">性别：</td>
		        		<td width="100" align="left">
		        		<select class="easyui-combobox" style="width:200px;" editable="false" id="userInfoDialog_userSex" data-options="panelHeight:'auto'">
		        		<option value="0">未知</option>
		        		<option value="1">女</option>
		        		<option value="2">男</option>
		        		</select>
		        		</td>
		        	</tr>	
					
					<tr height="30">
		          		<td width="87" align="right">用户类型：</td>
		        		<td width="100" align="left">
		        		<select class="easyui-combobox" style="width:200px;" editable="false" id="userInfoDialog_userType" data-options="panelHeight:'auto'">
		        		<option value="0">UAMS管理员</option>
	        			<option value="1">华大员工</option>
	        			<option value="2">外包同事</option>
	        			<option value="3">外部用户</option>
		        		</select>
		        		</td>
		        		<td width="87" align="right">员工状态：</td>
		        		<td width="100" align="left">
		        		<select class="easyui-combobox" style="width:200px;" editable="false" id="userInfoDialog_userState" data-options="panelHeight:'auto'">
		        		<option value="1" >在职</option>
		        		<option value="0" >离职</option>
		        		</select>
					</tr>
		        	<tr height="30">
		          		<td width="100" align="right">手机号码：</td>
		          		<td width="100" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_userMobile" data-options="required:true,missingMessage:'该输入项为必输项'"  style="padding: 0px; width: 200px;"></input></td>
					
		        		<td width="100" align="right">电子邮箱：</td>
		          		<td width="200" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_userEmail"  data-options="required:true,validType:'email',missingMessage:'该输入项为必输项'" style="padding: 0px; width: 200px;" ></input></td>
					</tr>
		        	<tr height="30">	
						<td width="87" align="right">QQ：</td>
		          		<td width="200" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_userQQ" style="padding: 0px; width: 200px;"></input></td>
		          		
		          		<td width="87" align="right">联系地址：</td>
		          		<td width="100" align="left"><input type="text" class="easyui-textbox" id="userInfoDialog_userAddr" style="padding: 0px; width: 200px;"></input></td>
		        	</tr>
	        	
					<tr height="30">
		          		<td width="100" align="right">角色：</td>
		          		<td width="100" align="left" colspan="3">
			          		<div class="datagrid-toolbar" id="role_comboGrid_tools" style="width:100%;height:45px;">
		          				<table>
			          				<tr>
				          				<td>系统名称：</td>
				          				<td>
				          				<input class="easyui-combobox" id="search_systemCode" size="15" editable="false" data-options="
						          			panelHeight:'200',
						          			valueField:'systemCode',
						          			textField:'systemName',
						          			url:'',
						          			loadFilter:function(data){
						          				return data.rows;
						          			},
						          			prompt:'精确查询'"
						          		/>
				          				</td>
				          				<td>角色名称：</td>
				          				<td>
				          					<input class="easyui-textbox" value="" id="roleName" name="roleName" size="15" data-options="prompt:'模糊查询'"/>
				          				</td>
				          				<td>
					          				<a href="javaScript:refleshSysRole();"style="float:left" name="sysRole_reflesh" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a>
					          				<div class="datagrid-btn-separator" style="float:left"></div>
						       				<a href="javaScript:querySysRole();" style="float:left" name="sysRole_query" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
						          			<div class="datagrid-btn-separator" style="float:left"></div>
				          				</td>
	          						 </tr>
          						</table>
	          				</div>
	          				<!-- <select id="roleIds" class="easyui-combogrid" style="width:490px;"></select> -->
					     	<input id="userRolesIds" class="easyui-combogrid" style="width:200px;" value=""/>
	          			</td>
	        		</tr>
	  			</table>
		  	</div>
		</div>		
	  	</div>
	    
	    <!--密码修改 -->
		<div id="paswUpdateDiv" iconCls="icon-save" style="width:400px;height:250px;">
			<div class="easyui-layout" fit="true">
			  	<div region="center" border="false" style="padding-top:20px;padding-left:10px;">
			  		<form action="" id="paswUpdateForm" method="post">
			  		<input type="hidden" id="paswUpdateId" name="userId"/>
			    	    <table id="fullPaswUpdateTable" >
			    	        <tr height="30">
			    	          <td class="tr">用户名:</td>
			    	          <td>
			    	            <input class="easyui-textbox" id="paswUpdateName" name="userName" type="text" size="40"  disabled="true"/>
			    	          </td>
			    	        </tr>
			    	        <tr height="30">
			    	          <td class="tr">真实姓名:</td>
			    	          <td>
			    	            <input class="easyui-textbox" id="paswUpdateRealName" name="realName" type="text" size="40" disabled="true" />
			    	          </td>
			    	        </tr>
			    	        <tr height="30">
			    	         <td class="tr">新密码:</td>
			    	           <td>
			    	            <input id="paswNewPassword" class="easyui-textbox" name="userMd5Pwd" type="password" data-options="required:true,missingMessage:'该输入项为必输项',validType:'userMd5Pwd',iconCls:'icon-lock',iconWidth:38" size="40" />  
			    	          </td>
			    	        </tr>
			    	        <tr height="30">
			    	         <td class="tr">确认密码:</td>
			    	           <td>
			    	            <input id="paswfirmPassword" class="easyui-textbox" type="password" data-options="required:true,missingMessage:'该输入项为必输项',validType:'userMd5Pwd',iconCls:'icon-lock',iconWidth:38" size="40" />  
			    	          </td>
			    	        </tr>
			    	    </table>
			  		</form>
			    </div>
			</div>
		</div>
		<!-- 授权数据 -->	
		<div id="authorizationDataDiv" iconCls="icon-save" style="width:400px;height:400px;">
			<div class="head">
				<div class="head-l">
					<div class="easyui-layout">
						<table style="line-height: 50px;">
							<tr align="left">
								<td  align="right" width="70" >数据名称：</td>
								<td >
									<input name="dataName" class="easyui-textbox" id="search_dataName" data-options="prompt:'数据名称'" style="width: 120px" />
								</td>
								<td  align="right" width="70" >数据类型：</td>
								<td >
									<input name="dataType" class="easyui-textbox" id="search_dataType" data-options="prompt:'数据类型'" style="width: 120px" />
								</td>
								<td  align="right" width="70" >Field：</td>
								<td >
									<input name="field" class="easyui-textbox" id="search_field" data-options="prompt:'Filed字段'" style="width: 120px" />
								</td>
								<td  align="right" width="70" >Option：</td>
								<td >
									<input name="option" class="easyui-textbox" id="search_option" data-options="prompt:'Option字段'" style="width: 120px" />
								</td>
							</tr>
						</table>
					</div>
					<div class="head-r">
						<a href="javascript:queryData()" name="data_query" class="easyui-linkbutton" iconCls="icon-search">查询</a>
				        <a href="javaScript:refreshData();" name="data_reload" style="float:left;" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
				    </div>    	
					<div class="body">
						<table id="userData" fit="true"  pagination="true" singleSelect="false" fitColumns="true"></table> 
					</div>
				</div>
				<!-- <div class="box-author operate">
					<a href="javaScript:saveUserDataMenu();" class="action-btn l-btn l-btn-small">保存授权</a>
					<a href="javaScript:delUserDataMenu();" class="action-btn l-btn l-btn-small">取消授权</a>
				</div> -->
		</div>
	</div>
	</body>
</html>
<%@ include file="/resources/common/page/button.jsp"%>